Skip to content

feat(parking): send Moshpit names to the Pit instead of a parked card - #87

Merged
ralyodio merged 1 commit into
masterfrom
feat/parking-to-pit
Aug 1, 2026
Merged

feat(parking): send Moshpit names to the Pit instead of a parked card#87
ralyodio merged 1 commit into
masterfrom
feat/parking-to-pit

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

A name in our own network was landing on this app's generic parked-domain page — "Scrambled IS COMING" about a name that is one click from being yours in the Pit. That's a dead end, and it isn't the network we're selling.

Change

/parking?name=<name> now 308s to <pit>/n/<name>.

Permanent rather than temporary on purpose: the name's home really is /n/<name>, so crawlers should follow the redirect and index the Pit's page for it, instead of holding on to a moshcoding.com URL that only ever bounces.

request result
/parking?name=hawaiian.chicken 308https://pit.moshcode.sh/n/hawaiian.chicken
/parking?name=scrambled.eggs 308https://pit.moshcode.sh/n/scrambled.eggs
/parking (no name) 308https://pit.moshcode.sh/pit
/parking?name=notaname 308https://pit.moshcode.sh/pit

The Pit base is PIT_BASE_URL (default https://pit.moshcode.sh). The host is fixed in code and safeDomain() validates the name before it's appended, so nothing that survives validation can redirect off-site — there's a test for exactly that.

Host-header parking for real clearnet domains is untouched — a genuine parked domain pointed at this service still renders its tenant page at /. This only changes the /parking route.

Verification

  • bun test tests/ — 148 pass, 0 fail (6 for this, replacing the previous toTenantParams tests)
  • bun run build clean, /parking still in the route table
  • Served locally and checked the real status codes and Location headers — the table above is measured, not assumed

🤖 Generated with Claude Code

A name in our own network was landing on this app's generic parked-domain
page — "Scrambled IS COMING" about a name that is one click from being
yours in the Pit. That is a dead end, and it is not the network we are
selling.

/parking?name=<name> now 308s to <pit>/n/<name>. Permanent, not
temporary, so crawlers follow it and index the Pit's page for the name
rather than holding on to a moshcoding.com URL that only ever bounces.

The Pit base is PIT_BASE_URL (default https://pit.moshcode.sh), and the
host is fixed in code — safeDomain() validates the name before it is
appended, so nothing that survives it can redirect off-site. No usable
name falls back to the Pit's front door rather than a 404.

Host-header parking for real clearnet domains is untouched: those still
render the tenant page at /.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit bba04cb into master Aug 1, 2026
2 checks passed
@ralyodio
ralyodio deleted the feat/parking-to-pit branch August 1, 2026 04:22
ralyodio added a commit that referenced this pull request Aug 1, 2026
#87 moved /parking?name= to the Pit, but that is not how a parked name
actually arrives. The DNS resolver points an unpointed name at this app
(DEFAULT_PARKING_HOST), so `curl scrambled.eggs` lands here as a Host
header and still rendered the "IS COMING" tenant card.

A name resolved from the Host now redirects to <pit>/n/<name>, while an
ordinary parked clearnet domain renders exactly as before.

Which is which is asked of the Pit per name, not by pulling its ending
list: that list is capped at 200 and `.eggs` already falls outside it, so
matching against it would quietly answer "no" for real names. resolve's
`registered` flag has no such ceiling.

307, not 308. The owner can point the name at a real target at any moment;
a permanent redirect cached in a browser would keep sending them here long
after this app stopped being the answer. /parking keeps its 308 — that URL
will always mean "go to the pit".

Fails closed: an unreachable Pit answers "not ours", so a registry outage
leaves every parked domain rendering as it does today rather than bouncing
the whole internet at /n/. Answers are memoised per name behind a 5-minute
TTL, with a bounded map because Host is attacker-controlled.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant